////////////////////////////////////////////////////////////////////////////////
//
//  This program is free software; you can redistribute it and/or modify 
//  it under the terms of the GNU Lesser General Public License as published 
//  by the Free Software Foundation; either version 3 of the License, or (at 
//  your option) any later version.
//
//  This program is distributed in the hope that it will be useful, but 
//  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
//  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
//  License for more details.
//
//  You should have received a copy of the GNU Lesser General Public License 
//  along with this program; if not, see <http://www.gnu.org/copyleft/lesser.html>.
//
////////////////////////////////////////////////////////////////////////////////

package merapi.gps.model
{
	import flash.net.registerClassAlias;
	

/**
 *  <code>GPSConfig</code> models data about the current GPS location. 
 *
 *  @see com.tesla.merapi.gps.messages.GPSMessage;
 *  
 *  @author Adam Flater - adamflater.net
 */
public class GPSConfig 
{
	{ registerClassAlias( "merapi.gps.model.GPSConfig", GPSConfig ); }
	
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Constructor.
     */
    public function GPSConfig() 
    {
        super();
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  notifyOnDelta
    //----------------------------------

    /**
     *  If true, messages will be sent when the delta of latitude or longitude is
     *  within latitudeDelta or longitudeDelta respectively
     */
    public function get notifyOnDelta() : Boolean 
    {
        return __notifyOnDelta;
    }
    public function set notifyOnDelta( val : Boolean ) : void 
    {
    	__notifyOnDelta = val;
    }
    
    //----------------------------------
    //  notifyOnTimeout
    //----------------------------------
    
    /**
     *  If true, messages will be sent when the timeout elapses.
     */
    public function get notifyOnTimeout() : Boolean 
    {
    	return __notifyOnTimeout;
    }
    public function set notifyOnTimeout( val : Boolean ) : void 
    {
    	__notifyOnTimeout = val;
    }
    
    //----------------------------------
    //  latitudeDelta
    //----------------------------------
    
    /**
     *  The delta threshold in latitude for sending a message
     */
    public function get latitudeDelta() : Number 
    {
    	return __latitudeDelta;
    }
    public function set latitudeDelta( val : Number ) : void 
    {
    	__latitudeDelta = val;
    }
    
    //----------------------------------
    //  latitudeDelta
    //----------------------------------
    
    /**
     *  The delta threshold in longitude for sending a message
     */
    public function get longitudeDelta() : Number 
    {
    	return __longitudeDelta;
    }
    public function set longitudeDelta( val : Number ) : void
    {
    	__longitudeDelta = val;
    }

    //----------------------------------
    //  timeout
    //----------------------------------
    
    /**
     *  The timeout threshold for sending a message
     */
    public function get timeout() : Number 
    {
    	return __timeout;
    }
    public function set timeout( val : Number ) : void
    {
    	__timeout = val;
    }


    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------

    /**
     *  Used by the getters/setters.
     */
    private var __latitudeDelta 	: Number		= .1;
    private var __longitudeDelta 	: Number		= .1;
    private var __notifyOnDelta 	: Boolean		= false;
    private var __notifyOnTimeout 	: Boolean		= false;
    private var __timeout 			: Number		= 500;	
    
} //  end class
} //  end package